fail nicely when passing unknown option to xm list
authorvh249@arcadians.cl.cam.ac.uk <vh249@arcadians.cl.cam.ac.uk>
Thu, 18 Aug 2005 11:45:54 +0000 (11:45 +0000)
committervh249@arcadians.cl.cam.ac.uk <vh249@arcadians.cl.cam.ac.uk>
Thu, 18 Aug 2005 11:45:54 +0000 (11:45 +0000)
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
tools/python/xen/xm/main.py

index e9f3bdb3c54bff43fce6b7f4dbc74aab08744675..e195196a5e055083864c98ca12d31c76533626cd 100644 (file)
@@ -200,7 +200,11 @@ def xm_migrate(args):
 def xm_list(args):
     use_long = 0
     show_vcpus = 0
-    (options, params) = getopt(args, 'lv', ['long','vcpus'])
+    try:
+        (options, params) = getopt(args, 'lv', ['long','vcpus'])
+    except GetoptError, opterr:
+        err(opterr)
+        sys.exit(1)
     
     n = len(params)
     for (k, v) in options: